package com.example.day02.presenter;

import com.example.day02.bean.BelleBean;
import com.example.day02.contract.HomeContract;
import com.example.day02.model.HomeModel;

public class HomePresenter implements HomeContract.Presenter, HomeContract.CallBack {

    HomeContract.View view;
    private final HomeModel model;

    public HomePresenter(HomeContract.View view) {
        this.view = view;
        model = new HomeModel();
    }

    @Override
    public void getData() {
        model.getData(this);
    }

    @Override
    public void onSuccess(BelleBean belleBean) {
        view.onSuccess(belleBean);
    }

    @Override
    public void onFail(String errorMsg) {
        view.onFail(errorMsg);
    }
}
